package com.example.fisttestproject;

import fi.iki.elonen.NanoHTTPD;

@Deprecated
public class AppServer extends NanoHTTPD {

    public AppServer(int port) {
        super(port);
    }

    @Override
    public Response serve(IHTTPSession session) {
        String uri = session.getUri();
        Method method = session.getMethod();
        System.out.println(uri);

        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        if (session.equals("test")){
            System.out.println("zehua test");
            return newFixedLengthResponse("zehua test");
        }
        System.out.println("Android request");
        return newFixedLengthResponse("Hello  Android!");
    }
}
